package bean;

public class SelectCourse {
    private Integer courseid;

    private Integer studentid;

    private Integer teacherid;

    private Integer mark;

    private String num;

    public Integer getCourseid() {
        return courseid;
    }

    public void setCourseid(Integer courseid) {
        this.courseid = courseid;
        updateNum();
    }

    public Integer getStudentid() {
        return studentid;
    }

    public void setStudentid(Integer studentid) {
        this.studentid = studentid;
        updateNum();
    }

    public Integer getTeacherid() {return  teacherid;}

    public void setTeacherid(Integer teacherid) {
        this.teacherid = teacherid;
        updateNum();
    }

    public Integer getMark() {return mark;}

    public void setMark(Integer mark) {
        this.mark = mark;
    }

    public String getNum() {return num;}

    private void updateNum() {
        this.num = (courseid != null ? courseid.toString() : "") +
                (studentid != null ? studentid.toString() : "") +
                (teacherid != null ? teacherid.toString() : "");
    }
}
